<template>
<div class="container">
    <div class="body-top">
        <div class="top-title">网上举报</div>
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="背景图配置" name="first" v-if="_SHOWBTN('wzgl-jdjb-wsjb-bjt')">
                <BannerConfig :ReportAll="ReportAll"></BannerConfig>
            </el-tab-pane>
            <el-tab-pane label="举报须知" name="second" v-if="_SHOWBTN('wzgl-jdjb-wsjb-xz')">
                <Tips :ReportAll="ReportAll"></Tips>
            </el-tab-pane>
            <el-tab-pane label="配置相关法律" name="third" v-if="_SHOWBTN('wzgl-jdjb-wsjb-flfg')">
                <Law :ReportAll="ReportAll"></Law>
            </el-tab-pane>
        </el-tabs>
    </div>
</div>
</template>

<script>
import BannerConfig from "./BannerConfig/BannerConfig";
import Tips from "./Tips/Tips";
import Law from "./Law/Law";

export default {
    components: {
        BannerConfig,
        Tips,
        Law,
    },
    data() {
        return {
            activeName: this.$store.state.PortalManagement.reportIsActive,
            ReportAll: {},
        };
    },
    created() {
        this.GetReportAll();

    },
    methods: {
        handleClick(tab, event) {
            // console.log(tab, event);
            this.$store.commit("PortalManagement/set_reportIsActive", tab.name)
            // console.log(this.$store.state.PortalManagement.reportIsActive, "网上举报控制")
        },
        //网上举报图片获取,举报须知，二维码举报共用一个接口
        GetReportAll() {
            this.Api.getReportAll().then((res) => {
                if (res.code === "0") {
                    this.ReportAll = res.data
                    // console.log(this.ReportAll)
                }
            });
        },
    },
};
</script>

<style lang="less" scoped>
.body-top {
    .top-title {
        height: 28px;
        font-size: 20px;
        font-family: PingFangSC-Medium, PingFang SC;
        font-weight: 500;
        color: rgba(51, 51, 51, 1);
        line-height: 28px;
        padding-left: 10px;
    }
}

/**tab-every */
/deep/.el-tabs__item {
    font-size: 14px;
    font-family: PingFangSC-Regular, PingFang SC;
    font-weight: 400;
    color: rgba(51, 51, 51, 1);
    line-height: 22px;
    margin-top: 14px;
}

/**tab底下1px线 */
/deep/.el-tabs__nav-wrap::after {
    height: 1px;
    background-color: #e4e7ed;
}

/deep/.el-tabs__nav,
.is-top {
    margin-left: 9px;
}

/deep/#tab-second {
    padding-left: 40px;
    padding-right: 40px;
}
</style>
